package salesforce;

import java.util.Arrays;

//LC 252 会议室
public class MeetingRoom {
    public boolean canAttendMeetings(int[][] intervals) {
        Arrays.sort(intervals, (i, j) -> i[0] - j[0]);
        for (int i = 0; i < intervals.length - 1; i++) {
            if(intervals[i][1] > intervals[i+1][0]){
                return false;
            }
        }
        return true;
    }
}
